#ifndef SMARTPOINTER_H_
#define SMARTPOINTER_H_

//Deprecated.

template< class T >
class CSmartPointer
{

private:

	T * m_Obj;
	bool m_bMove;

public:
	
	inline void move() const
	{
		
		m_bMove = true;
		
	}

	inline T * get() const
	{

		return m_Obj;

	}

	inline T * operator->()
	{
		
		return m_Obj;
		
	}
	const 
	inline T & operator*()
	{
		
		return &m_Obj;
		
	}
	
	inline T * operator=( T * p )
	{
		
		m_Obj = p;
		return p;
		
	}
	
	inline const T & operator=( const T & p )
	{
		
		m_Obj = p;
		return *p;
		
	}
	
	inline const T & operator=( const CSmartPointer & p )
	{
		
		m_Obj = p.get();
		return *m_Obj;
		
	}
	
	CSmartPointer( const CSmartPointer & p )
	{
		
		m_Obj = p.get();
		m_bMove = false;
		
	}
	
	CSmartPointer( T * o = NULL )
	{
		
		m_bMove = false;
		m_Obj = o;
		
	}
	
	~CSmartPointer()
	{
		
		if( m_bMove && m_Obj )
			delete m_Obj;
		
	}

};

#endif
